package com.hinnotek.amoeba.ui.activity.old

import android.os.Bundle
import android.view.View
import com.lee.common.base.BaseActivity
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.databinding.ActivityPackageChangeAddBinding
import com.hinnotek.amoeba.utilities.ClickUtil
import com.hinnotek.amoeba.utilities.ToastUtils
import com.xuexiang.xutil.common.StringUtils

class PackageChangeAddActivity : BaseActivity<ActivityPackageChangeAddBinding>() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setLeftVisible(true)
        setTitle("套餐变更申请")

        setContentView(R.layout.activity_package_change_add)
    }

    override fun initVew() {

        bindingView.superButtonSubmit.setOnClickListener(View.OnClickListener { v: View? ->
            if (ClickUtil.isFastClick()) {
                return@OnClickListener
            }
            val escPcChooseContractS = bindingView.escPcChooseContract.text.trim()
            if (StringUtils.isEmpty(escPcChooseContractS)) {
                ToastUtils.show(mContext, "请选择合同")
                return@OnClickListener
            }
            val escPcChooseUnitS =
                bindingView.escPcChooseUnit.editText.text.trim()
            if (StringUtils.isEmpty(escPcChooseUnitS)) {
                ToastUtils.show(mContext, "请选择签署单位")
                return@OnClickListener
            }
            val escPcChooseProjectS = bindingView.escPcChooseProject.editText.text.trim()
            if (StringUtils.isEmpty(escPcChooseProjectS)) {
                ToastUtils.show(mContext, "请选择选择项目")
                return@OnClickListener
            }
            val etPcLocationS = bindingView.etPcLocation.text.trim()
            if (StringUtils.isEmpty(etPcLocationS)) {
                ToastUtils.show(mContext, "请填写使用位置")
                return@OnClickListener
            }
            val etPcNumS = bindingView.etPcNum.text.trim()
            if (StringUtils.isEmpty(etPcNumS)) {
                ToastUtils.show(mContext, "请填写变更张数")
                return@OnClickListener
            }
            val etPcLastMoneyS = bindingView.etPcLastMoney.text.trim()
            if (StringUtils.isEmpty(etPcLastMoneyS)) {
                ToastUtils.show(mContext, "请填写原套餐金额")
                return@OnClickListener
            }
            val etPcLastFlowS = bindingView.etPcLastFlow.text.trim()
            if (StringUtils.isEmpty(etPcLastFlowS)) {
                ToastUtils.show(mContext, "请填写原套餐流量")
                return@OnClickListener
            }
            val etPcNowMoneyS = bindingView.etPcNowMoney.text.trim()
            if (StringUtils.isEmpty(etPcNowMoneyS)) {
                ToastUtils.show(mContext, "请填写变更套餐金额")
                return@OnClickListener
            }
            val etPcNowFlowS = bindingView.etPcNowFlow.text.trim()
            if (StringUtils.isEmpty(etPcNowFlowS)) {
                ToastUtils.show(mContext, "请填写变更套餐流量")
                return@OnClickListener
            }
            val escPcRelatedApproverS = bindingView.escPcRelatedApprover.editText.text.trim()
            if (StringUtils.isEmpty(escPcRelatedApproverS)) {
                ToastUtils.show(mContext, "请选择关联审批人")
                return@OnClickListener
            }
        })
    }

    override fun setData() {}
}